/**
 * Copyright 2011 Poltman.Ltd; www.poltman.com. All rights reserved.		
 *
 * This file is part of the dspace-poltman project http://www.poltman.com.
 *
 * This is free software; you can redistribute it and/or modify it under
 * the terms of DuraSpace DSpace license detailed in the LICENSE and NOTICE 
 * files at the root of the source tree and available online at
 * http://www.dspace.org/license/
 * 
 */
package com.poltman.dscentral.db.service.pm.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.poltman.dscentral.db.entity.pm.MainMenuGroupsEntity;
import com.poltman.dscentral.db.repository.pm.MainMenuGroupsRepository;
import com.poltman.dscentral.db.service.pm.MainMenuGroupsService;

/**
 * 
 * @author z.ciok@poltman.com
 * @version $Revision: 1770 $
 *
 */
@Repository
@Service("mainMenuGroupsService")
public class MainMenuGroupsServiceImpl implements MainMenuGroupsService {

	@Autowired
	private MainMenuGroupsRepository mainMenuGroupsRepository;	
	
	@Override
	public List<MainMenuGroupsEntity> findByShortcut(String shortcut) throws Exception {
		return mainMenuGroupsRepository.findByShortcut(shortcut);
	}
	
	@Override
	public List<String> findAllShortcuts() throws Exception {
		return mainMenuGroupsRepository.findAllShortcuts();
	}
	
	@Override
	public MainMenuGroupsEntity save(MainMenuGroupsEntity mainMenuGroupsEntity) throws Exception {
		return mainMenuGroupsRepository.save(mainMenuGroupsEntity);		
	}
	
	@Override
	public void deleteGroupByShortcut(String shortcut) throws Exception {
		mainMenuGroupsRepository.deleteGroupByShortcut(shortcut);	
	}
	
	@Override
	public List<String> findEPersonMenuItems(Integer userId) throws Exception {
		return mainMenuGroupsRepository.findEPersonMenuItems(userId);
	}
}
